<template>
  <div id="account_input_pwd">
    <!--顶部-->
		<header class="mui-bar mui-bar-nav">
			<a @tap="close_new_pwd" class="mui-icon mui-icon-left-nav mui-pull-left" style="color:#fff;"></a>
			<h1 class="mui-title"></h1>
		</header>
		<div class="mui-content">
			<div id="register_rorm">
				<div class="title">
					输入密码
				</div>
				<div class="inp phone">
					<input type="password" v-model="pwd1"  placeholder="新密码"/>
				</div>
				<div class="inp">
					<input type="password" v-model="pwd2"   placeholder="确认密码"/>
				</div>
				<div class="btn" @tap="submit_pwd">
				  确定
				</div>
				
			</div>
		</div>
  </div>
</template>
<script>
import account_ajax from "@/ajax/account_ajax.js";
export default {
  data(){
    return{
      pwd1:'', 
      pwd2:''
    }
  },
  methods: {
    close_new_pwd(){
      this.$store.commit("open_newpwd_view",false);
    },
    submit_pwd(){
      if(!this.pwd1||!this.pwd2){
        mui.toast("密码不能为空")
        return
      }
      if(this.pwd1==this.pwd2){
        mui.toast("成功")
        let new_pwd_type = this.$store.state.account.new_pwd_type;
        if(new_pwd_type=="new"){
          // 注册账号 填写密码
          let params = {
            phone:this.$store.state.account.new_pwd_phone,
            password:this.pwd1
          }
          account_ajax.register(params,res=>{
            console.log(res)
            this.$store.commit("login_view_init",false);
          })
        }else{
          // 找回密码  填写密码
          let params = {
            phone:this.$store.state.account.new_pwd_phone,
            password:this.pwd1
          }

          account_ajax.change_pwd(params,res=>{
            console.log(res)
            this.$store.commit("login_view_init",false);
          })
        }
         
        
      }else{
        mui.toast("输入错误")
      }
    }
  }
};
</script>
<style lang="less" scoped>
#account_input_pwd{
  background-color: #1c83fc;
  .mui-bar{
    box-shadow: none;
  }
}
ul,
ol {
  list-style: none;
}

body input[type="text"],
ul,
li,
input[type="password"] {
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
}
:-moz-placeholder {
  /* Mozilla Firefox 4 to 18 */
  color: #fff;
  opacity: 1;
}

::-moz-placeholder {
  /* Mozilla Firefox 19+ */
  color: #fff;
  opacity: 1;
}

input:-ms-input-placeholder {
  color: #fff;
  opacity: 1;
}
.mui-bar {
  background: transparent;
}
input::-webkit-input-placeholder {
  color: #fff;
  opacity: 1;
}
.clear {
  clear: both;
  height: 0;
  font-size: 0;
  line-height: 0;
  visibility: hidden;
  overflow: hidden;
}
/*顶部*/

/*登录表单*/
.mui-content {
  background: transparent;
}
#register_rorm {
  padding: 0 0.906rem/0.625;
  margin-top: 1.333rem/0.625;
}
#register_rorm .title {
  text-align: center;
  color: #fff;
  font-size: 0.8rem/0.625;
  margin: 0 0 2.666rem/0.625 0;
}
#register_rorm .inp {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 0.88rem/0.625;
  border-bottom: 2px solid #fff;
  margin-bottom: 0.5rem/0.625;
}
#register_rorm .inp input[type="text"],
#register_rorm .inp input[type="password"] {
  width: 5rem/0.625;
  height: 0.6rem/0.625;
  line-height: 0.6rem/0.625;
  background: transparent;
  color: #fff;
  font-size: 0.453rem/0.625;
  text-indent: 0.266rem/0.625;
}
#register_rorm .phone span {
  font-size: 0.44rem/0.625;
  color: #fff;
  display: flex;
  align-items: center;
}
#register_rorm .phone span i {
  font-size: 0.44rem/0.625;
}
#register_rorm .btn_span {
  color: #353535;
  font-size: 0.32rem/0.625;
  border-radius: 0.26rem/0.625;
  background: #e5e5e5;
  line-height: normal;
  padding: 0.1rem/0.625 0.4rem/0.625;
}
#register_rorm .btn_span:disabled {
  opacity: 1;
}
#register_rorm .ckeck {
  text-align: center;
  margin-bottom: 0.2rem/0.625;
}
#register_rorm .ckeck label {
  font-size: 0.293rem/0.625;
  color: #fff;
}
#register_rorm .ckeck i {
  font-size: 0.293rem/0.625;
  color: #fff;
}
#register_rorm .btn {
  width: 8rem/0.625;
  height: 1.066rem/0.625;
  line-height: 1.066rem/0.625;
  font-size: 0.52rem/0.625;
  color: #fff;
  text-align: center;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 0.1rem/0.625;
  margin-bottom: 0.373rem/0.625;
  margin-top: 1.373rem/0.625;
}
#register_rorm .txt {
  display: flex;
  justify-content: space-between;
}
#register_rorm .txt a {
  font-size: 0.426rem/0.625;
  color: #fff;
  text-decoration: underline;
}
#register_rorm .bottom {
  position: fixed;
  bottom: 1.12rem/0.625;
  width: 8rem/0.625;
  text-align: center;
  color: #fff;
}
#register_rorm .bottom p {
  color: #fff;
  margin-bottom: 0.573rem/0.625;
  font-size: 0.426rem/0.625;
}
#register_rorm .bottom .wx {
  width: 3.706rem/0.625;
  height: 0.786rem/0.625;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 2px solid #fff;
  border-radius: 0.2rem/0.625;
  margin: 0 auto;
}
#register_rorm .bottom .wx span {
  color: #fff;
}
#register_rorm .bottom .wx i {
  font-size: 0.48rem/0.625;
  margin-left: 0.133rem/0.625;
}
</style>

